function [yOut_cu] = modelFit(x_cu,model)
mats  = model.maturities;
if model.pruningOn == 1
    if model.appOrder == 1
        xf_cu      = x_cu(1:model.nx,1);
        y_cu       = model.g0  + model.gx*xf_cu;
        yields_cu  = model.by0(mats) + model.byx(mats,:)*xf_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*xf_cu;
        end
        x_cu = xf_cu;
    elseif model.appOrder== 2
        xf_cu                 = x_cu(1:model.nx,1);
        xs_cu                 = zeros(model.nx,1);
        xs_cu(1:model.nx1,1)  = x_cu(model.nx+1:model.nx+model.nx1,1);
        AA_cu                 = kron3(xf_cu,xf_cu);
        y_cu                  = model.g0        + model.gx*(xf_cu+xs_cu) + model.Gxx*AA_cu;
        yields_cu             = model.by0(mats) + model.byx(mats,:)*(xf_cu+xs_cu) + model.Byxx(mats,:)*AA_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*(xf_cu+xs_cu) + model.Rxx*AA_cu;
        end
        x_cu = xf_cu+xs_cu;
    elseif model.appOrder == 3
        xf_cu                 = x_cu(1:model.nx,1);
        xs_cu                 = zeros(model.nx,1);
        xs_cu(1:model.nx1,1)  = x_cu(model.nx+1:model.nx+model.nx1,1);
        xrd_cu                = zeros(model.nx,1);
        xrd_cu(1:model.nx1,1) = x_cu(model.nx+model.nx1+1:model.nx+2*model.nx1,1);
        AA_cu                 = kron3(xf_cu,xf_cu);
        AAA_cu                = kron(xf_cu,AA_cu);
        BB_cu                 = kron3(xf_cu,xs_cu);
        y_cu                  = model.g0 + model.gx*(xf_cu+xs_cu+xrd_cu) ...
                                + model.Gxx*(AA_cu+2*BB_cu) + model.Gxxx*AAA_cu ;
        yields_cu             = model.by0(mats) + model.byx(mats,:)*(xf_cu+xs_cu+xrd_cu) ...
                                + model.Byxx(mats,:)*(AA_cu+2*BB_cu) + model.Byxxx(mats,:)*AAA_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*(xf_cu+xs_cu+xrd_cu) ...
                + model.Rxx*(AA_cu+2*BB_cu) + model.Rxxx*AAA_cu;
        end
        x_cu = xf_cu+xs_cu+xrd_cu;
    end
else
    if model.appOrder == 1
        y_cu       = model.g0(mvars) + model.gx(mvars,:)*x_cu;
        yields_cu  = model.by0(mats) + model.byx(mats,:)*x_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*x_cu;
        end
    elseif model.appOrder == 2
        AA_cu      = kron3(x_cu,x_cu);
        y_cu       = model.g0(mvars) + model.gx(mvars,:)*x_cu + model.Gxx(mvars,:)*AA_cu;
        yields_cu  = model.by0(mats) + model.byx(mats,:)*x_cu + model.byxx(mats,:)*AA_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*x_cu + model.Rxx*AA_cu;
        end
    elseif model.appOrder == 3
        AA_cu      = kron3(x_cu,x_cu);
        AAA_cu     = kron3(AA_cu,x_cu);
        y_cu       = model.g0(mvars) + model.gx(mvars,:)*x_cu + model.Gxx(mvars,:)*AA_cu + model.Gxxx(mvars,:)*AAA_cu ;
        yields_cu  = model.by0(mats) + model.byx(mats,:)*x_cu + model.byxx(mats,:)*AA_cu + model.byxxx(mats,:)*AAA_cu;
        if model.inclSurveys == 1
            ER_cu  = model.r0 + model.rx*x_cu + model.Rxx*AA_cu + model.Rxxx*AAA_cu;
        end
    end
end
% Extra controls
%yExtra = ProjectExtraControls(y_cu,x_cu,model);
%hoursDev  = yExtra.l_cu-log(model.params.lss);
%wageDev   = yExtra.w_cu-log(model.params.Wss);

% Matching output to the data 
pos_l     = find(strcmp({'$l_t$'},model.labely));
pos_w     = find(strcmp({'$w_t$'},model.labely));
pos_c_ba1 = find(strcmp({'$c_{t-1}$'},model.labelx));
pos_myz   = find(strcmp({'$\mu _{z,t}$'},model.labelx));
pos_c     = find(strcmp({'$c_t$'},model.labely));
pos_pai   = find(strcmp({'$\pi_t$'},model.labely));
hoursDev  = y_cu(pos_l,1)-model.gSS(pos_l,1);
wageDev   = y_cu(pos_w,1)-model.gSS(pos_w,1);
dc        = 4*(y_cu(pos_c,1)-(x_cu(pos_c_ba1,1)+model.gSS(pos_c_ba1,1))+x_cu(pos_myz,1)+log(model.params.MUZss));
infl      = 4*y_cu(pos_pai,1);
yields    = 4*yields_cu;

if model.inclSurveys == 1
    % Conditional expectations of short rates included
    yOut_cu = [hoursDev wageDev dc infl yields' 4*ER_cu']';
else
    yOut_cu = [hoursDev wageDev dc infl yields' ]';
end
%yExtra_cu = [y_cu;yields_cu];

end
